Skip to content

feat: add apps list, orgs list, deployments list subcommands#94

Open
crowlbot wants to merge 1 commit into
feat/agent-json-outputsfrom
feat/agent-list-commands
Open

feat: add apps list, orgs list, deployments list subcommands#94
crowlbot wants to merge 1 commit into
feat/agent-json-outputsfrom
feat/agent-list-commands

Conversation

@crowlbot
Copy link
Copy Markdown

Summary

Stacked on #93 (which is stacked on #92#91). Adds the three list/inspect commands an agent typically needs to navigate the resource hierarchy without having seen the dashboard.

What's in this PR

  • `deno deploy apps list [--limit N] [--cursor C]` — paginated list of applications in the current organization. JSON mode emits `{ items: [{ id, slug, createdAt, updatedAt, layers }], nextCursor, org }`. Uses the existing `apps.listByPage` tRPC procedure.
  • `deno deploy orgs list` — organizations the current token can access. JSON mode emits `[{ id, slug, name, plan }]`. Uses `orgs.list`.
  • `deno deploy deployments list [--app A] [--limit N] [--cursor C] [--status S]` — paginated list of revisions for an app. `--status` accepts `skipped|queued|building|succeeded|failed` and is forwarded to the backend filter (any other value comes back as a backend USAGE error through the global envelope). JSON mode emits `{ items: [{ id, status, prod, createdAt, updatedAt, lastStep }], nextCursor, org, app }`.

All three honor the global `--json` flag (human tables via `tablePrinter` otherwise), and the global error envelope from #91 maps any NOT_AUTHENTICATED/NOT_FOUND/NETWORK responses without per-command code.

Test plan

  • `deno fmt` clean
  • `deno lint` clean
  • `deno check main.ts` — pre-existing TS/Cliffy errors only (the same `string[]`-instead-of-`string` option typing that already affects `env.ts`, `database.ts`, `sandbox/mod.ts`, etc.).
  • `deno test -A tests/agent.test.ts tests/create.test.ts` — 23/23 pass.
  • Verified `deno deploy apps --help` and `deno deploy deployments list --help` print expected flag layout.
  • tRPC payload shapes verified against the procedures in `denoland/deployng` (`apps.listByPage`, `orgs.list`, `revisions.listByPage`).

Notes

`apps`/`orgs`/`deployments` are introduced as new top-level subcommands rather than extending the existing `switch` or `logs` patterns, because each has its own pagination/filter shape and the help surface stays cleaner that way.

🤖 Generated with Claude Code

Fourth slice of the agent-ergonomics series. Adds the three list/inspect
commands an agent typically needs to navigate the resource hierarchy:

- `deno deploy apps list [--limit N] [--cursor C]` — paginated apps in
  the current org. JSON: `{ items, nextCursor, org }`. Uses
  `apps.listByPage`.
- `deno deploy orgs list` — orgs reachable by the token. JSON:
  `[{ id, slug, name, plan }]`. Uses `orgs.list`.
- `deno deploy deployments list [--app A] [--limit N] [--cursor C] [--status S]`
  — paginated revisions. JSON: `{ items, nextCursor, org, app }`.
  Uses `revisions.listByPage`.

All three honor the global `--json` flag and the global error envelope
from the foundation PR.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@crowlbot crowlbot force-pushed the feat/agent-list-commands branch from 3b79e96 to 83f452e Compare May 13, 2026 13:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant